//微信--微信菜单
import React from "react";
import PageTitle from "../../component/set/PageTitle";
import IconFont from "../../component/logo";
import SetButton from "../../component/set/SetBtton";
import { Table } from "antd";

class WeiXinMenu extends React.Component {
  state = {
    columns: [
      {
        title: "显示顺序",
        dataIndex: "sort",
      },
      {
        title: "菜单名称",
        dataIndex: "name",
      },
      {
        title: "触发动作",
        dataIndex: "action",
      },
      {
        title: "响应动作",
        dataIndex: "responseAction",
      },
      {
        title: "启用",
        dataIndex: "isUse",
      },
      {
        title: "操作",
        render: () => (
          <div>
            <SetButton txt="修改"></SetButton>
            <SetButton txt="删除"></SetButton>
          </div>
        ),
      },
    ],
    data: [
      {
        key: 1,
        sort: 1,
        name: "拼团攻略",
        action: "图文消息",
        responseAction: ".../....xxx",
        isUse: true,
        children: [
          {
            key: 2,
            sort: 2,
            name: "拼团攻略zi",
            action: "图文消息zi",
            responseAction: ".../....xxx",
            isUse: true,
          },
        ],
      },
      {
        key: 2,
        sort: 1,
        name: "拼团攻略",
        action: "图文消息",
        responseAction: ".../....xxx",
        isUse: true,
        children: [
          {
            key: 2,
            sort: 2,
            name: "拼团攻略zi",
            action: "图文消息zi",
            responseAction: ".../....xxx",
            isUse: true,
          },
        ],
      },
    ],
  };
  render() {
    return (
      <div className="WeiXinMenu">
        <PageTitle
          title="微信菜单"
          icon={<IconFont type="icon-caidan"></IconFont>}
          btn={
            <div style={{ display: "flex" }}>
              <SetButton txt="保存"></SetButton>
              <SetButton txt="生成自定义菜单"></SetButton>
            </div>
          }
        ></PageTitle>
        <Table columns={this.state.columns} dataSource={this.state.data} />
      </div>
    );
  }
}

export default WeiXinMenu;
